using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class StateMachine
{
    public PlayerStateBase CurrentState { get; private set; }


    public void SwitchState(PlayerStateBase nextState)
    {
        CurrentState?.OnExit();

        CurrentState = nextState;

        CurrentState?.OnEnter();
    }

    public void Update()
    {
        CurrentState?.OnUpdate();
    }
    
    public void FixedUpdate()
    {
        CurrentState?.OnFixedUpdate();
    }
}
